#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  attributes.py
#       Author @  Huoty
#  Create date @  2015-01-18 17:48:37
#  Description @  
# *************************************************************

import gtk
import pango

text = "Valour fate kinship darkness"
class PyApp(gtk.Window):
    def __init__(self):
        super(PyApp, self).__init__()

        self.connect("destroy", gtk.main_quit)
        self.set_title("Attributes")
        
        label = gtk.Label(text)
        
        attr = pango.AttrList()
        fg_color = pango.AttrForeground(65535, 0, 0, 0, 6)  # 设置前景色
        underline = pango.AttrUnderline(pango.UNDERLINE_DOUBLE, 7, 11) # 加下划线
        bg_color = pango.AttrBackground(40000, 40000, 40000, 12, 19) # 设置背景色
        strike = pango.AttrStrikethrough(True, 20, 29) # 加删除线
        
        size = pango.AttrSize(60000, 0, -1)  # 设置字体大小，后两个参数为文本坐标
        attr.insert(fg_color)
        attr.insert(underline)
        attr.insert(bg_color)
        attr.insert(size)
        attr.insert(strike)
        
        label.set_attributes(attr)
        
        fix = gtk.Fixed()
        fix.put(label, 5, 5)
        
        self.add(fix)
        self.set_position(gtk.WIN_POS_CENTER)
        self.show_all()

# Script starts from here

PyApp()
gtk.main()
